{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>学生实习与就业管理系统</title>
    <link href="{% static 'css/css2.css' %}" rel="stylesheet">
    <link rel="stylesheet" href="{% static 'css/bootstrap.css' %}">
    <link rel="stylesheet" href="{% static 'css/bold.css' %}">
    <link rel="stylesheet" href="{% static 'css/perfect-scrollbar.css' %}">
    <link rel="stylesheet" href="{% static 'css/bootstrap-icons.css' %}">
    <link rel="stylesheet" href="{% static 'css/app.css' %}">
    <style>
        .page-heading {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        #current-time {
            float: right;
            font-size: 25px;
        }

        h3 {
            float: left;
        }
    </style>
</head>
<body>
<div id="app">
    <div id="sidebar" class="active">
        <div class="sidebar-wrapper active">
            <div class="sidebar-header">
                <div class="d-flex justify-content-between">
                    <div class="logo"><a href=""><img src="{% static 'picture/logo.png' %}" alt="Logo" srcset=""></a>
                    </div>
                    <div class="toggler"><a href="#" class="sidebar-hide d-xl-none d-block"><i
                            class="bi bi-x bi-middle"></i></a></div>
                </div>
            </div>
            <div class="sidebar-menu">
                {# 功能菜单 #}
                <ul class="menu">
                    <li class="sidebar-title">系统功能</li>
                    {# 主页 #}

                    {# 不同的用户有不同的功能菜单 #}
                    {% block show_sidebar %}
                        {% if user_label == 2 %}
                            {#  企业主页  #}
                            <li class="sidebar-item active">
                                <a href="{% url 'organization:home' %}" class='sidebar-link'>
                                    <i class="bi bi-grid-fill"></i><span>主页</span></a>
                            </li>
                            {# 企业发布就业信息 #}
                            <li class="sidebar-item  ">
                                <a href="{% url 'organization:post_jobs' %}" class="sidebar-link">
                                    <i class="bi bi-grid-1x2-fill"></i><span>发布就业岗位</span>
                                </a>
                            </li>
                            {# 企业面试预约 #}
                            <li class="sidebar-item  ">
                                <a href="{% url 'organization:manage_interview' %}" class="sidebar-link">
                                    <i class="bi bi-grid-1x2-fill"></i><span>面试预约管理</span>
                                </a>
                            </li>
                            {# 企业发布实习 #}
                            <li class="sidebar-item  ">
                                <a href="{% url 'organization:show_internship' %}" class="sidebar-link">
                                    <i class="bi bi-grid-1x2-fill"></i><span>发布实习通知</span>
                                </a>
                            </li>
                        {% elif user_label == 1 %}
                            {#  学生主页  #}
                            <li class="sidebar-item active ">
                                <a href="{% url 'student:home' %}" class='sidebar-link'>
                                    <i class="bi bi-grid-fill"></i><span>主页</span></a>
                            </li>
                            {# 学生岗位信息 #}
                            <li class="sidebar-item">
                                <a href="{% url 'student:show_jobs' %}" class="sidebar-link">
                                    <i class="bi bi-people-fill"></i><span>就业岗位</span>
                                </a>
                            </li>
                            {# 学生面试预约 #}
                            <li class="sidebar-item">
                                <a href="{% url 'student:interview_list' %}" class="sidebar-link">
                                    <i class="bi bi-grid-1x2-fill"></i><span>面试预约</span>
                                </a>
                            </li>
                            {# 学生实习状态 #}
                            <li class="sidebar-item">
                                <a href="{% url 'student:internship_list' %}" class="sidebar-link">
                                    <i class="bi bi-stack"></i><span>实习状态</span>
                                </a>
                            </li>
                            {# 就业岗位推荐 #}
                            <li class="sidebar-item">
                                <a href="{% url 'student:recommend' %}" class="sidebar-link">
                                    <i class="bi bi-hexagon-fill"></i><span>就业岗位推荐</span>
                                </a>
                            </li>
                        {% elif user_label == 3 %}
                            {#  主页  #}
                            <li class="sidebar-item active ">
                                <a href="{% url 'supervisor:home' %}" class='sidebar-link'>
                                    <i class="bi bi-grid-fill"></i><span>主页</span></a>
                            </li>
                            {# 学生管理 #}
                            <li class="sidebar-item">
                                <a href="{% url 'supervisor:manage_student' %}" class="sidebar-link">
                                    <i class="bi bi-people-fill"></i><span>学生管理</span>
                                </a>
                            </li>
                            {# 企业管理 #}
                            <li class="sidebar-item">
                                <a href="{% url 'supervisor:manage_organization' %}" class="sidebar-link">
                                    <i class="bi bi-grid-1x2-fill"></i><span>企业管理</span>
                                </a>
                            </li>
                            {# 就业管理 #}
                            <li class="sidebar-item">
                                <a href="{% url 'supervisor:manage_job' %}" class="sidebar-link">
                                    <i class="bi bi-stack"></i><span>就业岗位管理</span>
                                </a>
                            </li>
                            {# 面试管理 #}
                            <li class="sidebar-item">
                                <a href="{% url 'supervisor:manage_interview' %}" class="sidebar-link">
                                    <i class="bi bi-stack"></i><span>面试预约管理</span>
                                </a>
                            </li>
                            {# 实习管理 #}
                            <li class="sidebar-item">
                                <a href="{% url 'supervisor:manage_internship' %}" class="sidebar-link">
                                    <i class="bi bi-stack"></i><span>实习管理</span>
                                </a>
                            </li>
                        {% else %}
                            <li class="sidebar-item active ">
                                <a href="#" class='sidebar-link'>
                                    <i class="bi bi-grid-fill"></i><span>主页</span></a>
                            </li>
                        {% endif %}

                    {% endblock %}
                    {# 退出登录 #}
                    <li class="sidebar-item ">
                        <a href="{% url 'logout' %}" class="sidebar-link">
                            <i class="bi bi-x-octagon-fill"></i>
                            <span>退出登录</span>
                        </a>
                    </li>

                </ul>
            </div>
            <button class="sidebar-toggler btn x"><i data-feather="x"></i></button>
        </div>
    </div>
    <div id="main">
        <header class="mb-3">
            <a href="#" class="burger-btn d-block d-xl-none">
                <i class="bi bi-justify fs-3"></i>
            </a>
        </header>
        <div class="page-heading">
            <h3>学生实习与就业管理系统</h3>
            <div id="current-time" style=""></div>

        </div>


        {# 显示页头 #}
        <div class="page-content" id="page-content">
            <section class="row">
                <div class="col-12 col-lg-9">
                    {% block page_head %}
                        {% if user_label == 1 %}
                            <div class="row">
                                <div class="col-6 col-lg-3 col-md-6">
                                    <div class="card">
                                        <div class="card-body px-3 py-4-5">
                                            <div class="row">
                                                <div class="col-md-4">
                                                    <div class="stats-icon purple"><i class="iconly-boldShow"></i></div>
                                                </div>
                                                <div class="col-md-8 d-flex align-items-center">
                                                    <h5 class="text-muted font-semibold">
                                                        <a href="{% url 'student:show_jobs' %}">就业岗位</a>
                                                    </h5>
                                                    <h6 class="font-extrabold mb-0" id="teacher_count"></h6></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-6 col-lg-3 col-md-6">
                                    <div class="card">
                                        <div class="card-body px-3 py-4-5 d-flex align-items-center">
                                            <div class="row">
                                                <div class="col-md-4">
                                                    <div class="stats-icon blue"><i class="iconly-boldProfile"></i>
                                                    </div>
                                                </div>
                                                <div class="col-md-8 d-flex align-items-center">
                                                    <h5 class="text-muted font-semibold"><a
                                                            href="{% url 'student:home' %}">个人信息</a>
                                                    </h5>
                                                    <h6 id="student_count" class="font-extrabold mb-0"></h6>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-6 col-lg-3 col-md-6">
                                    <div class="card">
                                        <div class="card-body px-3 py-4-5">
                                            <div class="row">
                                                <div class="col-md-4">
                                                    <div class="stats-icon green"><i class="iconly-boldAdd-User"></i>
                                                    </div>
                                                </div>
                                                <div class="col-md-8 d-flex align-items-center"><h5
                                                        class="text-muted font-semibold"><a
                                                        href="{% url 'student:interview_list' %}">面试预约</a></h5>
                                                    <h6 class="font-extrabold mb-0" id="org_count"></h6></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-6 col-lg-3 col-md-6">
                                    <div class="card">
                                        <div class="card-body px-3 py-4-5">
                                            <div class="row">
                                                <div class="col-md-4">
                                                    <div class="stats-icon red"><i the="iconly-boldBookmark"></i></div>
                                                </div>
                                                <div class="col-md-8 d-flex align-items-center"><h5
                                                        class="text-muted font-semibold"><a
                                                        href="{% url 'student:internship_list' %}">实习状态</a></h5>
                                                    <h6 class="font-extrabold mb-0" id="apt_count"></h6></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        {% elif user_label == 2 %}
                            <div class="row">
                                <div class="col-6 col-lg-3 col-md-6" style="width: 50%">
                                    <div class="card">
                                        <div class="card-body px-3 py-4-5">
                                            <div class="row">
                                                <div class="col-md-4">
                                                    <div class="stats-icon purple"><i class="iconly-boldBookmark"></i>
                                                    </div>
                                                </div>
                                                <div class="col-md-8 d-flex align-items-center">
                                                    <h5 class="text-muted font-semibold">
                                                        <a href="{% url 'organization:show_jobs' %}">就业岗位</a>
                                                    </h5>
                                                    <h6 class="font-extrabold mb-0" id="teacher_count"></h6></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-6 col-lg-3 col-md-6" style="width: 50%">
                                    <div class="card">
                                        <div class="card-body px-3 py-4-5">
                                            <div class="row">
                                                <div class="col-md-4">
                                                    <div class="stats-icon blue"><i class="iconly-boldActivity"></i>
                                                    </div>
                                                </div>
                                                <div class="col-md-8 d-flex align-items-center">
                                                    <h5 class="text-muted font-semibold"><a
                                                            href="{% url 'organization:manage_interview' %}">面试预约管理</a>
                                                    </h5>
                                                    <h6 id="student_count" class="font-extrabold mb-0"></h6>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        {% else %}
                            <div class="row">
                                <div class="col-6 col-lg-3 col-md-6" style="width: 20%">
                                    <div class="card">
                                        <div class="card-body px-3 py-4-5">
                                            <div class="row">
                                                <div class="col-md-4">
                                                    <div class="stats-icon purple"><i class="iconly-boldBookmark"></i>
                                                    </div>
                                                </div>
                                                <div class="col-md-8 d-flex align-items-center">
                                                    <h5 class="text-muted font-semibold">
                                                        <a href="{% url 'supervisor:manage_student' %}">学生管理</a>
                                                    </h5>
                                                    <h6 class="font-extrabold mb-0" id="teacher_count"></h6></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-6 col-lg-3 col-md-6" style="width: 20%">
                                    <div class="card">
                                        <div class="card-body px-3 py-4-5">
                                            <div class="row">
                                                <div class="col-md-4">
                                                    <div class="stats-icon blue"><i class="iconly-boldActivity"></i>
                                                    </div>
                                                </div>
                                                <div class="col-md-8 d-flex align-items-center">
                                                    <h5 class="text-muted font-semibold"><a
                                                            href="{% url 'supervisor:manage_organization' %}">企业管理</a>
                                                    </h5>
                                                    <h6 id="student_count" class="font-extrabold mb-0"></h6>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-6 col-lg-3 col-md-6" style="width: 20%">
                                    <div class="card">
                                        <div class="card-body px-3 py-4-5">
                                            <div class="row">
                                                <div class="col-md-4">
                                                    <div class="stats-icon purple"><i class="iconly-boldBookmark"></i>
                                                    </div>
                                                </div>
                                                <div class="col-md-8 d-flex align-items-center">
                                                    <h5 class="text-muted font-semibold">
                                                        <a href="{% url 'supervisor:manage_job' %}">就业岗位管理</a>
                                                    </h5>
                                                    <h6 class="font-extrabold mb-0" id="teacher_count"></h6></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-6 col-lg-3 col-md-6" style="width: 20%">
                                    <div class="card">
                                        <div class="card-body px-3 py-4-5">
                                            <div class="row">
                                                <div class="col-md-4">
                                                    <div class="stats-icon blue"><i class="iconly-boldActivity"></i>
                                                    </div>
                                                </div>
                                                <div class="col-md-8 d-flex align-items-center">
                                                    <h5 class="text-muted font-semibold"><a
                                                            href="{% url 'supervisor:manage_interview' %}">面试预约管理</a>
                                                    </h5>
                                                    <h6 id="student_count" class="font-extrabold mb-0"></h6>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-6 col-lg-3 col-md-6" style="width: 20%">
                                    <div class="card">
                                        <div class="card-body px-3 py-4-5">
                                            <div class="row">
                                                <div class="col-md-4">
                                                    <div class="stats-icon blue"><i class="iconly-boldActivity"></i>
                                                    </div>
                                                </div>
                                                <div class="col-md-8 d-flex align-items-center">
                                                    <h5 class="text-muted font-semibold"><a
                                                            href="{% url 'supervisor:manage_internship' %}">实习管理</a>
                                                    </h5>
                                                    <h6 id="student_count" class="font-extrabold mb-0"></h6>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        {% endif %}
                    {% endblock %}
                </div>
                <div class="col-12 col-lg-3">
                    {% block show_user %}
                        {% if user_label == 1 %}
                            {# 当学生用户登录的时候显示学生的姓名和学号 #}
                            <div class="card">
                                <div class="card-body py-4 px-5">
                                    <div class="d-flex align-items-center">
                                        {# 性别不同默认头像不一样 #}
                                        <div class="avatar avatar-xl">
                                            {% if gender == 'female' %}
                                                <img src="{% static 'picture/5.jpg' %}" alt="Face female">
                                            {% else %}
                                                <img src="{% static 'picture/2.jpg' %}" alt="Face male">
                                            {% endif %}
                                        </div>
                                        {# 加载学生的姓名和学号 #}
                                        <div class="ms-3 name"><h5 class="font-bold">姓名：{{ student.stu_name }}</h5>
                                            <h6 class="text-muted mb-0">
                                                学号：{{ request.session.user_id }}
                                            </h6>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        {% elif user_label == 2 %}
                            {# 当企业登录的时候显示组织的名称和账号 #}
                            <div class="card">
                                <div class="card-body py-4 px-5">
                                    <div class="d-flex align-items-center">
                                        <div class="avatar avatar-xl">
                                            <img src="{% static 'picture/5.jpg' %}" alt="Face female">
                                        </div>
                                        {# 加载企业的姓名和学号 #}
                                        <div class="ms-3 name"><h5 class="font-bold">名称：{{ organization.name }}</h5>
                                            <h6 class="text-muted mb-0">
                                                账号：{{ request.session.user_id }}
                                            </h6>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        {% elif user_label == 3 %}
                            <div class="card">
                                <div class="card-body py-4 px-5">
                                    <div class="d-flex align-items-center">
                                        <div class="avatar avatar-xl">
                                            <img src="{% static 'picture/5.jpg' %}" alt="Face female">
                                        </div>
                                        {# 加载企业的姓名和学号 #}
                                        <div class="ms-3 name"><h5 class="font-bold">管理员</h5>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        {% else %}
                            <div class="card">
                                <div class="card-body py-4 px-5">
                                    <div class="d-flex align-items-center">
                                        <div class="avatar avatar-xl"><img src="{% static 'picture/1.jpg' %}"
                                                                           alt="Face 1">
                                        </div>
                                        <div class="ms-3 name">
                                            <a href="{% url 'student:login' %}">
                                                <button class="btn btn-block btn-xl btn-light-primary font-bold">
                                                    点击登录
                                                </button>
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        {% endif %}


                    {% endblock %}
                </div>
            </section>
        </div>


        {# 显示页体 #}
        {% block show_body %}
            <div class="row">
                <div class="col-12">
                    <div class="card">
                        <div class="card-header"><h4>当前状态未登录</h4></div>
                        <div class="card-body">
                            <h1>欢迎访问学生实习与就业管理系统</h1>
                        </div>
                    </div>
                </div>
            </div>
        {% endblock %}

        {# 显示页尾 #}
        <footer>
            <div class="footer clearfix mb-0 text-muted">
                <div class="float-start"><p>2024 &copy;InternshipEmploymentPlatform</p></div>
            </div>
        </footer>
    </div>
</div>
<script src="{% static 'js/perfect-scrollbar.min.js' %}"></script>
<script src="{% static 'js/bootstrap.bundle.min.js' %}"></script>
<script src="{% static 'js/apexcharts.js' %}"></script>
<script src="{% static 'js/dashboard.js' %}"></script>
<script src="{% static 'js/main.js' %}"></script>
<script src="{% static 'js/perfect-scrollbar.min.js' %}"></script>
<script src="{% static 'js/bootstrap.bundle.min.js' %}"></script>
<script src="{% static 'jquery/dist/jquery.min.js' %}"></script>
<script src="{% static 'formvalidation/js/formValidation.js' %}"></script>
<script src="{% static 'formvalidation/js/framework/bootstrap.js' %}"></script>
<script src="{% static 'formvalidation/js/language/zh_CN.js' %}"></script>
<script>
    const pageHeading = document.querySelector('#current-time');
    setInterval(() => {
        const now = new Date();
        const year = now.getFullYear();
        const month = now.getMonth() + 1;
        const day = now.getDate();
        const weekday = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"][now.getDay()];
        const timeing = now.toLocaleTimeString();
        const timeString = `当前时间:  ${year}/${month}/${day} ${weekday} ${timeing}`
        pageHeading.textContent = timeString;
    }, 1000);
</script>
{% block script_block %}

{% endblock %}
</body>
</html>